package com.wn.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Objects;

/**
 *
 * @Document 对对 ES中的 文档数据
 *
 * indexName 对应 索引
 *
 *     @Field(type = FieldType.Text,analyzer = "ik_max_word")
 *       字段   FieldType.Text类型  analyzer 分词
 *
 *      @Field(type = FieldType.Integer)
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "student_index",shards = 1,replicas = 1)
public class Student {
    @Id
    private String id;
    @Field(type = FieldType.Keyword)
    private String name;
 
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String desc;
 
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String data;
 
    @Field(type = FieldType.Integer)
    private Integer age;
}